from nltk.stem.wordnet import WordNetLemmatizer
from nltk.stem.lancaster import LancasterStemmer
class Token:
	def __init__(self, word, pos, lemmatizer, consider_pos=True):
		lmtzr = lemmatizer
		# stemmer = LancasterStemmer()
		self.pos = pos
		word = word.lower()
		if (self.pos=="JJR" or self.pos=="JJS"):
			self.word = lmtzr.lemmatize(word,'a')
		elif (self.pos=="VBD" or self.pos=="VBG" or self.pos=="VBN" or self.pos=="VBP" or self.pos=="VBZ"):
			self.word = lmtzr.lemmatize(word,'v')
		else:
			self.word = lmtzr.lemmatize(word,'n')
		if (self.pos=="JJR" or self.pos=="JJS"):
			self.pos = "JJ"
		if (self.pos=="NNS" or self.pos=="NNP" or self.pos=="NNPS"):
			self.pos = "NN"
		if (self.pos=="PRP$"):
			self.pos = "PRP"
		if (self.pos=="RBR" or self.pos=="RBS"):
			self.pos = "RB"
		if (self.pos=="VBD" or self.pos=="VBG" or self.pos=="VBN" or self.pos=="VBP" or self.pos=="VBZ"):
			self.pos = "VB"	
		if (not consider_pos):
			self.pos = ""
if __name__ == "__main__":
	tok = Token("seeing", "VBG")
	print tok.word